package com.peko.oracle.controller;

import com.peko.oracle.dao.TestMapper;
import com.peko.oracle.entity.TestEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Peko
 */
@RestController
public class Controller {

    @Resource
    private TestMapper testMapper;

    @GetMapping(value = "test")
    public void test(){
        System.out.println("测试");
        List<TestEntity> lists = testMapper.find();
        System.out.println(lists);

    }

    @GetMapping(value = "add")
    public void add(){
        TestEntity entity = new TestEntity();
        entity.setId(3);
        entity.setName("Peko");
        int i = testMapper.insert(entity);

        System.out.println("i = "+i);

    }

}
